<?php
namespace app\api\controller;

use cmf\controller\HomeBaseController;
use app\api\BLL\TestBLL;

class TestController extends HomeBaseController
{
    private $bll;

    public function __construct(TestBLL $test)
    {
        parent::__construct();
        $this->bll = $test;
    }

    public function index()
    {
        echo "test";
    }

    public function apitest(){
        $parameter = input('parameter');
        $data['parameter']=$parameter;
        if($this->bll->create($data)){
            $ret = ['code'=>1,'msg'=>'ok'];
        }else{
            $ret = ['code'=>0,'msg'=>'error'];
        }
        return json($ret);
    }
}
